# -*- coding: utf-8 -*-
import datetime

from testcase.test_login import *
from testcase.test_employeeinfointegrity import *
import datetime
from unittestreport import TestRunner


if __name__ == "__main__":

    # unittest.main()
    # suite = unittest.defaultTestLoader.discover('./testcase', pattern='test_login.py')
    #
    # with open("E:/report.html", "wb") as file:
    #     runner = HTMLTestRunner.HTMLTestRunner(stream=file, title='工作台自动化测试报告',
    #                                            description='测试结果如下：')
    #     runner.run(suite)
    now = datetime.datetime.now()
    time1=now.strftime("%Y-%m-%d %H_%M_%S")
    filename = "%s.html" % (time1)
    print(filename)
    suite = unittest.defaultTestLoader.discover('./testcase', pattern='test_*.py')
    runner = unittestreport.TestRunner(suite, tester='孙彪', filename="%s测试报告.html"%(time1), report_dir="report",
                                       title="数智系统自动化测试报告",
                                       desc="自动化测试报告",
                                       templates=2)

    runner.run(thread_count=3)